package com.loongnoy.controller;


import com.loongnoy.entity.Point;
import com.loongnoy.entity.ResultMsg;
import com.loongnoy.service.PointService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


@RestController
@RequestMapping("/point")
public class PointController {

    @Autowired
    private PointService pointService;

    @PostMapping("/add")
    public ResultMsg add(@RequestBody Point point) {
        point = pointService.save(point);
        return new ResultMsg(1, "积分账户创建成功", point);
    }
} 